#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>

int main(int argc, char const* argv[])
{
    int fd;
    char buf[10];
    
    fd = open("file", O_RDONLY);
    if (fd < 0)
    {
        perror("open error");
        return 0;
    }

    printf("read %d\n", read(fd, buf, 3));
    printf("read %d\n", read(fd, buf, 5));

    return 0;
}
